import 'package:fish_redux/fish_redux.dart';

import 'action.dart';
import 'state.dart';

Reducer<LoginVerifyState> buildReducer() {
  return asReducer(
    <Object, Reducer<LoginVerifyState>>{
      LoginVerifyAction.action: _onAction,
      LoginVerifyAction.upVerify: _upVerify,
    },
  );
}

LoginVerifyState _onAction(LoginVerifyState state, Action action) {
  final LoginVerifyState newState = state.clone();
  return newState;
}

LoginVerifyState _upVerify(LoginVerifyState state, Action action) {
  final LoginVerifyState newState = state.clone();
  newState.length = action.payload;
  return newState;
}
